package com.api.shopapi.service.impl;

import com.api.shopapi.entity.MedicationItem;
import com.api.shopapi.mapper.MedicationItemMapper;
import com.api.shopapi.service.MedicationItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("MedicationItemServiceImplOne")
public class MedicationItemServiceImpl implements MedicationItemService {

    @Autowired
    private MedicationItemMapper medicationItemMapper;


    @Override
    public int insert(MedicationItem medicationItem) {
        return medicationItemMapper.insert(medicationItem);
    }

    @Override
    public int updateByMedicationItemCode(MedicationItem medicationItem) {
        return medicationItemMapper.updateByMedicationItemCode(medicationItem);
    }

    @Override
    public int delByMedicationGroupCode(String medicationGroupCode) {
        return medicationItemMapper.delByMedicationGroupCode(medicationGroupCode);
    }

    @Override
    public List<MedicationItem> getByMedicationGroupCode(String medicationGroupCode) {
        return medicationItemMapper.getByMedicationGroupCode(medicationGroupCode);
    }
}
